import 'package:faker/service/rssapi.dart';
import 'package:flutter/material.dart';
import 'package:webfeed/domain/dublin_core/dublin_core.dart';
import 'package:webfeed/domain/rss_category.dart';
import 'package:webfeed/domain/rss_cloud.dart';
import 'package:webfeed/domain/rss_feed.dart';
import 'package:webfeed/domain/rss_image.dart';
import 'package:webfeed/domain/rss_item.dart';

class RssModel with ChangeNotifier{
  RssApi rssApi = RssApi();
  RssBean rssBean;


  Future<RssBean> getRss(route) async {
    return await rssApi.getRss(route);
  }

}

class RssBean
{

  String title;
  String author;
  String description;
  String link;
  List<RssItem> items;

  RssImage image;
  RssCloud cloud;
  List<RssCategory> categories;
  List<String> skipDays;
  List<int> skipHours;
  String lastBuildDate;
  String language;
  String generator;
  String copyright;
  String docs;
  String managingEditor;
  String rating;
  String webMaster;
  int ttl;
  DublinCore dc;

  RssBean({
    this.title,
    this.author,
    this.description,
    this.link,
    this.items,
    this.image,
    this.cloud,
    this.categories,
    this.skipDays,
    this.skipHours,
    this.lastBuildDate,
    this.language,
    this.generator,
    this.copyright,
    this.docs,
    this.managingEditor,
    this.rating,
    this.webMaster,
    this.ttl,
    this.dc,
  });


  String getauthor()
  {
    return this.author;
  }

  List<RssCategory> getcategories(){
    return this.categories;
  }

  RssCloud getcloud(){
    return this.cloud;
  }

  String getcopyright(){
    return this.copyright;
  }

  DublinCore getdc(){
    return this.dc;
  }

  String getdescription(){
    return this.description;
  }

  String getdocs(){
    return this.docs;
  }

  String getgenerator(){
    return this.generator;
  }

  RssImage getimage(){
    return this.image;
  }

  List<RssItem> getitems(){
    return this.items;
  }

  String getlanguage(){
    return this.language;
  }

  String getlastBuildDate(){
    return this.lastBuildDate;
  }

  String getlink(){
    return this.link;
  }

  String getmanagingEditor(){
    return this.managingEditor;
  }

  String getrating(){
    return this.rating;
  }

  List<String> getskipDays(){
    return this.skipDays;
  }

  List<int> getskipHours(){
    return this.skipHours;
  }

  String gettitle(){
    return this.title;
  }

  int getttl(){
    return this.ttl;
  }

  String getwebMaster(){
    return this.webMaster;
  }

}